package com.enation.app.javashop.core.client.fallback.member;

import com.enation.app.javashop.core.client.feignimpl.member.ShopLogisticsCompanyClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.enation.app.javashop.model.shop.dos.ShopLogisticsSetting;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 店铺站内信熔断器fallback factory
 * @author kingapex
 * @version 1.0
 * @data 2022/5/28 14:27
 **/
@Component
public class ShopLogisticsCompanyClientFallbackFactory extends BaseFallbackFactory<ShopLogisticsCompanyClientFeignImpl> {
    @Override
    protected ShopLogisticsCompanyClientFeignImpl fallback() {
        return new ShopLogisticsCompanyClientFallback();
    }

    /**
     * 会员地址熔断
     *
     * @author zh
     * @version v7.0
     * @date 19/9/27 下午3:27
     * @since v7.0
     */
    @Component
    public static class ShopLogisticsCompanyClientFallback implements ShopLogisticsCompanyClientFeignImpl {

        private final Logger logger = LoggerFactory.getLogger(getClass());


        @Override
        public List queryListByLogisticsId(Long logisticsId) {
            logger.error("查询店铺物流出错，id："+logisticsId);
            return null;
        }

        @Override
        public void deleteByLogisticsId(Long logisticsId) {
            logger.error("删除店铺物流出错，id："+logisticsId);
        }

        @Override
        public ShopLogisticsSetting query(Long logisticsId, Long sellerId) {

            logger.error("查询某商家的物流公司出错，logisticsId："+logisticsId+"，sellerId："+sellerId);

            return null;
        }
    }
}
